const router = require('koa-router')(),
      userController = require('../controllers/User'),
      userLoginCheckMW = require('../middlewares/userLoginCheck');

router.prefix('/user');

router.get('/register', userController.getRegister);
router.post('/register', userController.createUser);
router.post('/submit-answer', userLoginCheckMW, userController.submitProblemAnswer);
router.get('/recom-problem', userLoginCheckMW, userController.recommendProblem);
router.get('/refresh-recom-problem', userLoginCheckMW,  userController.refreshRecomProblem);

router.get('/user-center', userLoginCheckMW, userController.getUserCenter);

router.get('/login', userController.getLoginPage);
router.post('/login-action', userController.loginAction);
router.get('/logout-action', userLoginCheckMW,  userController.logoutAction);
router.get('/login-check', userController.loginCheck);

module.exports = router;